package com.longteng.java.web;

import com.longteng.java.web.dto.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by tianqing.wang
 * DATE : 2018/3/31
 * TIME : 下午11:11
 * PROJECT : web-lesson
 * PACKAGE : com.longteng.java.web
 *
 * @author <a href="mailto:celeskyking@163.com">tianqing.wang</a>
 */
@RestController
public class SendController {


    @GetMapping(value = "/send",produces = {"application/json"})
    public UserInfo getInfo(@RequestParam("user")String user){
        UserInfo userInfo = new UserInfo();
        userInfo.setAge("30");
        userInfo.setType("default");
        userInfo.setUser(user);
        return userInfo;
    }


    @PostMapping(value = "/send",produces = {"application/json"})
    public UserInfo postInfo(@RequestBody UserInfo userInfo){
        return userInfo;
    }
}
